package com.mairuide.platmanager;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.mairuide._frame.base.BaseModel;

/**
 * 平台用户(登录用)
 * @author mh
 *
 */
@Entity
@Table(name="tb_plat_manager")
public class PlatManager extends BaseModel {


	/**
	 * 主键
	 */
	@Id
	@Column(name="id")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "plat_manager")
	@SequenceGenerator(name = "plat_manager", sequenceName = "SEQ_PLAT_MANAGER",allocationSize=1)
	private Integer id;
	
	/**
	 * 登录名
	 */
	@Column(name="login_name")
	private String loginName;
	
	/**
	 * 密码
	 */
	@Column(name="password")
	private String password;
	
	/**
	 * 昵称(代理商用户显示代理商名称，内部员工显示员工姓名)
	 */
	@Column(name="nick_name")
	private String nickName;
	
	/**
	 * 角色姓名
	 */
	@Transient
	private String roleName;
	
	/**
	 * 外键：tb_oem.id
	 */
	@Deprecated
	@Transient
	private Integer oemId;
	
	/**
	 * 状态(100:启用,200:禁用)
	 */
	@Column(name="state")
	private Integer state;
	
	/**
	 * 创建时间
	 */
	@Column(name="create_time")
	private Date createTime;
	
	/**
	 * 创建人ID
	 */
	@Column(name="create_id")
	private Integer createId;
	
	/**
	 * 创建人姓名
	 */
	@Column(name="creater_name")
	private String createrName;
	
//	
//	/**
//	 * 客户经理ID
//	 */
//	@Column(name="account_manager_id")
//	private Integer accountManagerId;
//	
//	
//	/**
//	 * 客户经理名称
//	 */
//	@Column(name="account_manager_name")
//	private String accountManagerName;
//	
	/**
	 * 上级ID(数据库中 superior_name 不要使用了。总部的上级是null，其他都有值)
	 */
	@Column(name="superior_id")
	private Integer superiorId;
	
	/**
	 * 上级姓名
	 */
	@Transient
	private String superiorName;
	
	/**
	 * 是否子账号(0和null不是, 1是)
	 */
	@Column(name="is_sub_account")
	private Integer isSubAccount;
	
	/**
	 * 联系电话
	 */
    @Column(name="phone")
    private String phone;
    
//	/**
//	 * 代理商-销售ID(从 tb_plat_manager表中，role_code = SALES_MANAGER 选择的人的ID)
//	 */
//	@Column(name="agent_sale_id")
//	private Integer agentSaleId;
//	
//    /**
//     * 代理商销售姓名
//     * @return
//     */
//    @Column(name="agent_sale_name")
//    private String agentSaleName;
//    
//    /**
//     * 代理商地区
//     * @return
//     */
//    @Enumerated(EnumType.ORDINAL)
//    @Column(name="agent_region")
//    private AgentRegion agentRegion;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}
	
	@Deprecated
	public Integer getOemId() {
		return oemId;
	}

	@Deprecated
	public void setOemId(Integer oemId) {
		this.oemId = oemId;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Integer getCreateId() {
		return createId;
	}

	public void setCreateId(Integer createId) {
		this.createId = createId;
	}

	public String getCreaterName() {
		return createrName;
	}

	public void setCreaterName(String createrName) {
		this.createrName = createrName;
	}


	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public Integer getSuperiorId() {
		return superiorId;
	}

	public void setSuperiorId(Integer superiorId) {
		this.superiorId = superiorId;
	}

	public String getSuperiorName() {
		return superiorName;
	}

	public void setSuperiorName(String superiorName) {
		this.superiorName = superiorName;
	}

	public Integer getIsSubAccount() {
		return isSubAccount;
	}

	public void setIsSubAccount(Integer isSubAccount) {
		this.isSubAccount = isSubAccount;
	}
	
}
